UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sFba3PJ1NWFoH7vCzTKqd2pU9eE6eS7adP/pTAYnAMQ=' 
WHERE 
  key_id = '2606190367c70405e1ba594afe84c6265dc1fc83378394e2785042a7f883ea77' 
  AND (
    token = 'sFba3PJ1NWFoH7vCzTKqd2pU9eE6eS7adP/pTAYnAMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022