UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QXokytCisz/eJOx2kwbKHeGyyEuWghaPrBBcV6WaxPg=' 
WHERE 
  key_id = '22662743e5770b8e7c16ac22875bae71f4baae018fd628df17c694eb02f535a9' 
  AND (
    token = 'QXokytCisz/eJOx2kwbKHeGyyEuWghaPrBBcV6WaxPg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022