UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XArnz+GwxB7Nlm8yuqSgMXjmyk7RekawV3ejdqJWqKw=' 
WHERE 
  key_id = '0599ee456a57e44926cdc4a7f4786a7c0cd54d66c0dbd5e4cddcd21a1ef0a7db' 
  AND (
    token = 'XArnz+GwxB7Nlm8yuqSgMXjmyk7RekawV3ejdqJWqKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028