UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g5KfitnDb+x3OZXWjpTuelHY1NnAaHvAMWGI8cNoATo=' 
WHERE 
  key_id = '8b92003e6d8c9ab4bdf2bef890ef3d8446b05668411866a883e646ee4f8b31a6' 
  AND (
    token = 'g5KfitnDb+x3OZXWjpTuelHY1NnAaHvAMWGI8cNoATo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055