UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bmqWvhpQ3TyHmFwQuGm5qEK6otDLXEC6MBSTFHdTNk0=' 
WHERE 
  key_id = 'd7ca579c9583b28b92cef78a2dedac3905ab438c6e2bd2df0e37a24e463861f6' 
  AND (
    token = 'bmqWvhpQ3TyHmFwQuGm5qEK6otDLXEC6MBSTFHdTNk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027