UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'utoItmuxQmii+k1opmZiGaYT+ENpCktcWgSPMkKWkPs=' 
WHERE 
  key_id = '9c025719d130f4d43361f8d3d4f38b9ce0762be6051ed4c867caea4a4adad439' 
  AND (
    token = 'utoItmuxQmii+k1opmZiGaYT+ENpCktcWgSPMkKWkPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019