What you need here is the special relativity version of the work-energy theorem.
The proof is given in many places, including that Wikipedia page, but you start out from the idea that the relativistic force is given by :
$$\vec{F}=\frac{d}{dt}(\gamma m_0 \vec{v})$$
and you will (after some math) get :
$$m_0c^2(\gamma_2-\gamma_1)=\int_{\vec{x_1}}^{\vec{x_2}}\vec{F}\cdot d\vec{x}$$
Where the subscripts refer to initial and final positions. The expression on the left is the change in kinetic energy, and the expression on the right is simply the work done.
For the simple harmonic oscillator in your case that reduces to :
$$W_{21}=\frac{1}{\gamma_2-\gamma_1}\frac k 2 (x_2^2-x_1^2)k$$