The whole point of key cards is that the code changes with every new guest, so you shouldn’t be able to use an old key card in any room until it is re-programmed. This sounds like a huge failure in security if they didn’t reset the codes with every guest.