The Validity of the 2 cards is independent of each other.
If the validity of the Metro Card is expired, it will stop working at the metro gates for travel. However, you may continue to use tmw Card for shopping.
Similarly, if the validity of the tmw Card is expired it will stop working for in retail or on online websites for shopping. However, you may continue to use the Metro card for travelling in Metro.