UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nt+V8Wlvq5s7XesRkWGZDQETP4GqRdmblWln4D8gm3o=' 
WHERE 
  key_id = '728fe3f63830710f2bde64707ac2c975f47c247bf9ce5ebc456887ae698c0d3c' 
  AND (
    token = 'Nt+V8Wlvq5s7XesRkWGZDQETP4GqRdmblWln4D8gm3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023