Electrolysis Anode equation

In the electrolysis of $\ce{Na2SO4}$, is it valid to write the anode half-reaction (oxidation) as $$\ce{OH-} \rightarrow \ce{H+} + \frac{1}{2}\ce{O2} + 2\ce{e-}$$?

My book says it's $$\ce{H2O} \rightarrow 2\ce{H+} + \frac{1}{2}\ce{O2} + 2\ce{e-}.$$

Other than the additional $\ce{H+}$, there's no difference between the two.

This depends on the medium in which you do the electrolysis. In the case of a basic medium your equation would be more correct, but in the case of an acidic medium your answer would be wrong, since the concentration of $\ce{OH-}$ ions would be far too small.
Generally: In acidic medium you balance your redox equations using $\ce{H+}$ and $\ce{H2O}$, in basic medium you balance with $\ce{OH-}$ and $\ce{H2O}$.
Note: Since you generate $\ce{H+}$ ions it is possible to argue that starting with a solution at $\text{pH}=7$ gives you an acidic medium, resulting in the equation in the book.