The picture on the right shows that it fits what's known as a "warded" lock. The wards are what keeps just any key from working, but it is low tech. The shape of the "cross section" of the key helps to limit use for other locks. Try taking a Kwickset key and placing it in a Schlage lock and you'll see what I mean. These are the old "mortise locks" and still can be purchased new for reproduction of doors from the early 1900s or before. Making these keys and repairing those locks was one of my favorite tasks as a locksmith.
Also, be aware that these keys can still be purchased from locksmiths and fitted to older locks. But the fact that the front or "bit" end has that unique curvature (in key2.jpg) to it seems to be different from today's flat sided keys like the (key1.jpg) picture seems to show. As a former locksmith I would be led to believe that it is an older key that you've found. It looks in good shape for being dug up from the ground. However, it is also possible that if can be from a later manufactured lock as well. Depending on what it's made of may have helped it to survive better if in fact it is older.