Since only the homepage is slow, I think that the total stats are not "cached" but calculated on the spot. This means that the homepage will become slower every day as there will be more bets (and explains the 10 - 25 second load time upon opening the site.) In extreme examples it could time-out the visitor, leading to a 504 error. Heavy SQL queries like that can slow down the whole site too (making some "homepage loads" look like a DDoS attack.) If that's not the problem, I would advise putting some debug timer to see where it takes too much time on the homepage. To me it seems obviously 1 specific problem on the homepage, and if it gets slower after time IMO most times it's database related as the DB gets bigger.
I PMed this to cryptasm twice on the chatbox, but didn't get reply, so will just say it here.