The reason one would take caffeine before a 5k is simply because it's a mental stimulant. It effectively makes you believe you have more energy. Numerous studies have shown that caffeine allows one to work out for a longer period of time. Unfortunately, studies have also shown that caffeine can slightly decrease maximum sprinting velocity and is detrimental to short to mid distance races. Additionally from personal experience, I would suggest taking caffeine on workout days to increase your workout intensity and thus help you better prepare, but come race day I wouldn't take too much caffeine. It sounds like you already have placed too much pressure on yourself to perform well in this race. Caffeine will enhance you nervousness, and anxiety, which have both been shown to decrease performance if they are above the optimum level. In conclusion because it's a long race the psychological effects of the caffeine may help you keep your pace in the race longer, but if it makes you too anxious your muscles will tighten up and thus you'll have to expend more energy and you'll tire much sooner than if you didn't take it. My suggestion is if you don't easily feel the effects of pressure and anxiety take the caffeine. otherwise stay away.