UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZlrFmTT4LuYTOHYHaBCMeURw2H21r0jV3tgppLjEDqo=' 
WHERE 
  key_id = 'c89f8a4c36724f74e079b93b88efb8b7b7762dfa35432bf12a084b18cf3a04b5' 
  AND (
    token = 'ZlrFmTT4LuYTOHYHaBCMeURw2H21r0jV3tgppLjEDqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014