If you're 40, you have ( or should have) nearly a couple of decades of hard-won experience in building software, working within organizations to get things done, and subject matter expertise in the types of projects you worked on [0]. That should show up both in your resume / work history and in the more challenging projects you're able to take on.
Don't try to compete with younger people based on number of hours or cost; that is a game you are guaranteed to lose.
[0] Conversely, if you don't have those things, now is the time to start stepping up to the plate and acquiring them. The best of the younger people you are competing with are already working hard at doing so.