Generalized complex Swift-Hohenberg equation for optical parametric oscillators