If you're a 40-year-old investor, you're probably not planning on retiring for another 20 years or more. While that may be bit of a downer for those looking forward to the freedom  retirement can bring, the positive is that it gives you more than two decades to grow your investments as you prepare for that fateful day.

However, if you're 40 or older, your risk appetite may not be what it was back in your 20s. You want growth, but you don't want to risk losing your shirt to get it.

Fortunately, there are some businesses that, thanks to their dominant competitive advantages, offer an excellent combination of growth and relative safety. Read on to learn about two of the best.

Image source: Getty Images.

As the largest credit card payment networks, Visa (V 0.44%) and MasterCard (MA 0.47%) are well positioned to profit from the massive global shift toward electronic payments and away from cash transactions.

For financial services companies, having a respected and trusted brand is of paramount importance. Fortunately, both Visa and MasterCard excel in this regard. In fact, both Visa and MasterCard were named to brand consultancy company Interbrand's Best Global Brands list for 2015, with Visa's brand value rising 15% from 2014, and MasterCard's rising 17%.

MasterCard and Visa also enjoy powerful network effects, as each new merchant that accepts their credit cards makes their networks more valuable to consumers, and each new consumer who carries their cards increases the potential pool of customers for participating merchants (thanks to an easier means of purchase and, therefore, likelihood of sale).

These credit card titans earn a small fee from every transaction that passes through their payment networks, and their tollbooth-like business models produce steady cash flow that Visa and MasterCard pass on to shareholders in the form of fast-growing dividends and substantial share buybacks. It also helps these highly profitable businesses earn impressive returns on capital -- another strong sign of competitive advantage.

But as massive and dominant as Visa and MasterCard are, tremendous growth opportunities still lie ahead for them. That's because about 85% of global transactions still take place via cash or check. The trend toward credit card and digital payments will likely continue for many years, potentially making Visa and MasterCard multi-decade investment opportunities.

All told, Visa and MasterCard's trusted brands, powerful network effects, and tollbooth-like business models help to form a wide protective moat around their ever-rising profits. These strong competitive advantages make it unlikely these payment leaders will be displaced by the competition, thereby making their stocks relatively low-risk investments. Additionally, Visa and MasterCard's ultra long-term growth prospects align well with the time horizons of investors in their 40s.

Together, this excellent combination of growth and safety make Visa and MasterCard solid stocks for 40-year-old investors to consider buying.