UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7+Km6wz1xUIwzUPAzP3Q6S/Hm0yBYL7Rl/5kWgpTC50=' 
WHERE 
  key_id = '6b9614a07402a65ab257882ed79afa0e00c9f158eaeb2c6d652e0d0c6560d109' 
  AND (
    token = '7+Km6wz1xUIwzUPAzP3Q6S/Hm0yBYL7Rl/5kWgpTC50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068