No, 40,000 miles is not a lot for a used car.
The general rule of thumb is that a car should have 12,000 miles for every year that it is old. And while 40,000 miles might be a lot to have driven within a year or two, at the end of the day, that’s still a pretty new car—and probably young enough that you’ll have some time before it runs into issues.
If you’re looking at a used car that’s three or four years old and has 40,000 miles on the odometer, that is totally normal.