Replacing a variable in an AST

I like to replace a variable by an atom in an arbitrary expression. I know the name of the variable, but not where it occurs in the expression.

What is the best way to perform such replacement?

defmacro replace_var(var, expr) do .... end

Should I use Macro.prewalk or can I use bindings in a smart way?