UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4LcTFOT+5JoVf/3xpLr8dU365U0EC+gsdrUdy3lnTPM=' 
WHERE 
  key_id = '80bad99901319ef253a64abdc87929d37132f58dd521c77f0eaa4929f59e3eae' 
  AND (
    token = '4LcTFOT+5JoVf/3xpLr8dU365U0EC+gsdrUdy3lnTPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028