UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qox9H4SDr5dWKcoU4dI/kyeeHNSfoQ52fypOm4l1NfY=' 
WHERE 
  key_id = '7fdb579fb199899ceaaa7b3d2d93c2ff30f472da614879aa189aae3e87e03511' 
  AND (
    token = 'qox9H4SDr5dWKcoU4dI/kyeeHNSfoQ52fypOm4l1NfY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033