UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V/Ea2oc7vg3Pzb31mjef66Tp0GPk3UVEJ6rAG/P4EK0=' 
WHERE 
  key_id = '674b8d7d6bac9f84e2e05dfa8538f9dfe385b8252a3e893385170ac2bae4d257' 
  AND (
    token = 'V/Ea2oc7vg3Pzb31mjef66Tp0GPk3UVEJ6rAG/P4EK0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037