Another alternative with cl-loop:
cl-loop
(progn (setq a (list 1 2 3 4 5 6)) (cl-loop for v in-ref a when (eq v 3) do (setf v 22)))