If the account number has not changed, the card will continue to work after the expiration date. All that most payment gateways and credit card companies require is that when you attempt to charge it, you give an expiration date that is in the future. I've seen some recommend that if the card on file is expired, just add 3 years to the expiration date and try it.
Also, VISA and MC both provide an updater service, that some payment gateways make available to some merchants. The updater service allows a merchant to ask for an update on the status of a credit card. Possible responses are: no update available; account is closed; here is the new expiration date for the card; card was replaced and here is the new number and expiration date. The service is pretty cheap. One of the card companies charges something like $150 to sign up, the other charges nothing. Queries are free if there is no updated information available, and something like $0.10 if updated information is returned. They do require that you query for all your stored cards at least once a year.
This doesn't work for all cards. Although the service is provided by VISA and MC, it is up to the individual bank or other organization that actually issued the card to decide if they will support it. When we started using it, it boosted revenue on subscription billing by maybe 2-3%.
I don't think the updater service is available to everyone. I believe they do some looking over your history to try to ensure that you aren't the kind of business that would be misusing the service. I'm sure Amazon would qualify.