UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k725pPyPGHw+fLTtzbRFj6NhouFqL3cKOSKT4ytno1o=' 
WHERE 
  key_id = '3974cc646eaa2b6f42abaa9e150346f1d5fc734e80ca75e86e4f0d466fcc28de' 
  AND (
    token = 'k725pPyPGHw+fLTtzbRFj6NhouFqL3cKOSKT4ytno1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032