Most probably your device is not synced with Google 2FA time servers. On smartphones, it is a good idea to set the time setting to be automatically updated over the network.


iPhone: Settings -> General -> Date and Time


Android: Settings -> Date and time settings