If you looked at the innards of an all-in-one it's basically a laptop on a stand. So it'll last about as long as a laptop would. In theory it can last for a good long while. (I have a laptop that's over ten years old that I'll still use from time to time, although I don't expect to play sims or any other games on it.) In practice it'll last until it's not good enough to handle what you want it to do. The one you linked looks fine to play sims and do some mild web browsing, if that's all you're interested in.
Still, looking around walmart/amazon/newegg I can find refurbished towers that are as good for less money. If this is about you wanting to save money, a refurb is a good idea. If you really want an all-in-one because you think it looks nicer without all the desk clutter you're free to go for it. It's just a question of what your priorities are.