UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GMKbPPYfiMFr53/PmJobReCx2AJ8Tqp8Dm2Qm/jfHMo=' 
WHERE 
  key_id = 'cf3d7e54f5d43f4598085631411dd6d206453b12608b95594614546498b12417' 
  AND (
    token = 'GMKbPPYfiMFr53/PmJobReCx2AJ8Tqp8Dm2Qm/jfHMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025