Phase-controlled two-wave mixing in a moving grating