Evolution of the Carter constant for resonant inspirals into a Kerr black hole: I. The scalar case