Most sites or applications will accept passcodes from within some window of the current time (maybe the ones before and after as well as the current one). After all, it takes some time to type the code in and there may be network delay. But it is also a requirement that the same passcode not be accepted twice (so if you for some reason get logged out immediately, you might have to wait 30 seconds to get a new one to log back in).