Riding in extreme heat can be dangerous. But again it does come down to conditioning. Water is key. I forget the exact numbers but keep drinking the water.
You could avoid it by hitting the nearest mountain and doing a big climb. If I am in whistler valley it can be 30c (not very hot but this is an example) I can climb up a few trails for a couple of hours and the temp is a full 10c less.