While square mattresses are not commonly found in the market, there are some companies that offer custom-made square mattresses. However, simply rotating a square mattress by 90 degrees may not necessarily increase its lifespan, as it depends on the specific construction and materials used in the mattress. (It would 100% increase the usable lifespan of any mattress if you could rotate it 90 degrees. It is definitely a good thing to rotate a mattress 180 degrees but this of course means neither partner sleeps on the centre which leads to a ridge forming over time. There would be an area in the very centre where a slight elevation would occur but that would be less of an issue)
In general, rotating a mattress every three to six months can help distribute the wear and tear more evenly and potentially prolong its lifespan. However, it's important to note that some (the vast majority) mattresses are designed to be one-sided, meaning they are not meant to be flipped over, and can only be rotated.
If you're looking for a mattress that is specifically designed to last longer, you may want to consider investing in a high-quality mattress with durable materials, such as memory foam (worst choice) or latex (best choice), and a sturdy base or foundation. Additionally, using a mattress protector can help protect your mattress from spills, stains, and other damage that can shorten its lifespan. (spills and stains do not often reduce the lifespan of your mattress but they do void your warranty)