By storing it for 2 years and testing it after.
> I wonder what other environmental controls could extend the shelf life of common, expensive medication?
Common, expensive is an oxymoron. The vast majority of all medication in use is practically free to produce. The packaging of drugs typically costs more than the drugs themselves. Drug discovery has long concentrated on small-molecular-weight drugs that can be mass-produced for a pittance. The reason drugs cost so much is that proving that they are safe and that they work costs so much. Because of this, there is little economic sense in trying to preserve drugs for longer (which would require more extremely expensive trials), when you can just trash the drugs and order up a new batch that has a combined msrp of $100M for $5k.
In their economics, small molecular weight drugs share more with software than with, say, bread. That is, practically all of the economic cost is upfront investment and the replication cost is non-existent.
Apart from biologic drugs, most small molecule compounds are dirt cheap to produce. So cheap that nobody is even striving to produce them in a cheaper, more efficient way. If you compare this kind of industry with chemical specialty industries, where the mindset is to increase yield as much as possible, in pharma the production cost is not much of a consideration. So, what you pay for your drugs has almost no relationship to how much it costs to produce. You are paying for patents, market exclusivity and the whole system that goes with it (the pharma companies are not the only ones benefiting from it).
> How did they come to an expected shelf-life of 2 years in the first place?
Stability studies supporting 2 years data (submission to approval takes one year, and compiling all data before submission for filing is a 6 months process, so you can start submission with 1 year stability data in your hands, and tell the regulatory agencies you will provide the 2 years data during the second half of the regulatory review to get 2 years).
Because that's good enough for most drugs. 3 years is usually ideal, but not always necessary. If your drug is used in high volume most patients won't get batches that are produced long ago anyway.
Some medication that expires quickly can be extended simply by refrigerating it. I wonder what other environmental controls could extend the shelf life of common, expensive medication?