UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U4JgaYllQvrpYOjEoS22HqSEWhb+wGQWMOkQgUJAtAw=' 
WHERE 
  key_id = '972072b4b728900215eb0a457e629de9e1769eed4c29be2a969c412f36c75bea' 
  AND (
    token = 'U4JgaYllQvrpYOjEoS22HqSEWhb+wGQWMOkQgUJAtAw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055