I'd scratch the old m42's, and go for a da35mm f2.4 first (buy the lens second hand would be my advice). The kits lens is quite good, but the da35 is a big step up (and much easier to use than the old manual primes).
The k50/k30 are nice all round cameras. The d5300 has got better image quality than the k30/k50, but you'd need some nice glass to get the best out of it, and you're unlikely to notice the difference on web based images. The k series has weather sealing, and a better viewfinder, so it's probably a nicer camera to use in the field. I'd go for the pentax myself, although to be fair, this is a pentax forum, so I doubt you'd expect me to offer a different opinion