UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xj7np4X0Q4iDpyWc7SLnR5RNUEVGxqPOLChaswPe4fE=' 
WHERE 
  key_id = '16f75679684c96ea3ef63d84cfcf9fa01762206cb880b49c86abc0f81d80be9b' 
  AND (
    token = 'xj7np4X0Q4iDpyWc7SLnR5RNUEVGxqPOLChaswPe4fE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038