UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QEZUP3Pz3YFqQi7pecc1xILQpIIO1Fvp7OogPs6/ZSY=' 
WHERE 
  key_id = 'fce274776e3734de3f64caafbba3995771cf871a0e4e7e33956214e2355ae085' 
  AND (
    token = 'QEZUP3Pz3YFqQi7pecc1xILQpIIO1Fvp7OogPs6/ZSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035