Do you mean that varying conditions make medicines last longer? You can't mean that medicines would last much longer if stored in perfect conditions, because that's not expiring "earlier than they should", it's expiring exactly on time for the poor conditions they are kept in.
Can you clarify?