Quasi-phase-matching (QPM) is a widely adopted technique for mitigating stringent momentum conservation in nonlinear optical processes such as second-harmonic generation (SHG). It effectively compensates for the phase velocity mismatch between optical harmonics by introducing a periodic spatial modulation to the nonlinear optical medium. Such a mechanism has been further generalized to the spatiotemporal domain, where a non-stationary spatial QPM can induce a frequency shift of the generated light. Here we demonstrate how a spatiotemporal QPM grating, consisting in a concurrent spatial and temporal modulation of the nonlinear response, naturally emerges through all-optical poling in silicon nitride microresonators. Mediated by the coherent photogalvanic effect, a traveling space-charge grating is self-organized, affecting momentum and energy conservation, resulting in a quasi-phase-matched and Doppler-shifted second harmonic. Our observation of the photoinduced spatiotemporal QPM expands the scope of phase matching conditions in nonlinear photonics.