It will not matter if it is near the expiration date or just expired, but if it is too long, you will not be able to stay in a hotel, take a plane or other means of transportation, so you should replace it with a new one as soon as possible. Or use other valid documents to travel, such as passports, military ID cards, etc. are also possible.