UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U04YkgvmKC7FIg6d0uGG/NL99U0UAiQvzrlQfqyC05M=' 
WHERE 
  key_id = '5f162ba6bc866ae8ede126c71b716ac85b9ad6220183d9812b5e78e4f188c6c2' 
  AND (
    token = 'U04YkgvmKC7FIg6d0uGG/NL99U0UAiQvzrlQfqyC05M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032