I've got a D40 that must be around 10 years old now so I'm wondering if it's worth upgrading?

Looking to spend around 300. Something with a flip screen would probably be useful as well.