UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WPM6SOuT/eUlCSvbiuXJgahXz9q10p1m915YetAMFDo=' 
WHERE 
  key_id = '7c6154a347a4274ef26205714627b9d926f9e48eba6e53d94ddc17992dfb7fff' 
  AND (
    token = 'WPM6SOuT/eUlCSvbiuXJgahXz9q10p1m915YetAMFDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036