UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/7cA7dgbtTP2nbSbO3O+Vjbh+EvZHGdUDCf5hIbKw8w=' 
WHERE 
  key_id = '3eee489660b94e893d7d13673e643af770aaef2e73db2aced768d8d3c8e77d33' 
  AND (
    token = '/7cA7dgbtTP2nbSbO3O+Vjbh+EvZHGdUDCf5hIbKw8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029