UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M8ZEchVSbZKQLIe3o4UTHs7BQEvy50STocTXEBuDWuM=' 
WHERE 
  key_id = '84fb8c30cb183308bd6ca6b275c4119dc681be36ae67a02ee77b4be9e591006c' 
  AND (
    token = 'M8ZEchVSbZKQLIe3o4UTHs7BQEvy50STocTXEBuDWuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022