We consider multidimensional gravity with a Lagrangian containing the Ricci tensor squared and the Kretschmann invariant. In a Kaluza-Klein approach with a single compact extra space of arbitrary dimension, with the aid of a slow-change approximation (as compared with the Planck scale), we build a class of spatially flat cosmological models in which both the observed scale factor a(tau) and the extra-dimensional one, b(tau), grow exponentially at large times, but b(t) grows slowly enough to admit variations of the effective gravitational constant G within observational limits. Such models predict a drastic change in the physical laws of our Universe in the remote future due to further growth of the extra dimensions.