That's pretty hard to say, especially depending on region, year of model, age, etc. Also, depreciation isn't linear, therefore, it depends on what stage of life as to how quickly it is depreciating.
However, to try to make a feeble attempt at answering the question:
Considering the age of a 2004 (8 years old), I wouldn't think that 40,000 miles would equate to more than a few hundred bucks...or $1000 at most.
Personally, I hate buying vehicles with high mileage. I bought my 2003 with only 2,000 miles on it. So, I ended up with a near brand new truck but didn't have to pay the brand new price. However, I don't mind if I rack up a zillion miles because I know that I maintained the vehicle. When buying a truck with a bunch of miles, you have no idea what a previous owner(s) may have done.
For a test you could run your scenario on KBB or NADA.
2003 V6 SR5, 4WD TRD, Xtra Cab, 5 speed, 265/75 BFG A/T KOs, Deckplate, Snugtop camper, Bedrug, Full Amsoil Synthetic Lubricants, 5% Tint, Yakima Roof Rack, ARB Bull Bar, Warn M8000, Toytec Coilovers, 1.5" AAL, Bilstein 5100s, KC Daylighters, Magnaflow catback