An optimally accurate second-order time-stepping algorithm for the nonstationary magneto-hydrodynamics equations