It is a little old, but that shouldn’t necessarily scare you away. From the sample images I looked at, the image quality/sensor noise seems quite good. I think that would be a pretty good deal, except you say the 18-55mm lens is broken! Do you know any details on that? What exactly is broken? Is it usable at all? You will almost surely want a wide-angle lens, so you will need to buy one if the one that comes with it is broken.
You can get a Nikon 18-55mm lens for about $70 on ebay here.
Overall, I think it would make a good camera for someone just starting out in photography. The most important thing is the photographer, not the camera, so buying the new Nikon D5300 will NOT automagically improve your photography. I shoot with a Canon EOS Rebel T3 which is slightly newer, but still outdated by today’s standards.
Here is a link to a review that will tell you all you could possibly want to know about the D40x.