UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nupVQQazd3gWv18Uintqcw7V3jKg6Uq8nBSv9ind73M=' 
WHERE 
  key_id = '905abff190bdd030a064a9d7f25d020506a3a9f980d4693757054d6fd332c93e' 
  AND (
    token = 'nupVQQazd3gWv18Uintqcw7V3jKg6Uq8nBSv9ind73M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042