I think the real issue here is sort of an x-y problem, what you really should be asking is how do I keep the computer from getting too hot in the first place. First you need to define what is too hot for your comfort and for your specific setup, for example my rule when I overclocked my CPU was must be below 80C under max load in Prime95. Second, you overclock in increments and in steps, you don't just set your 4690k to 5Ghz and go for it, so you should know when you are approaching your max. My steps were as follows: 1) bump the multiplier by one, 2) run said stress test, check stability and temperatures 3) if stable, go to 1 else continue 4) is voltage safe, if yes continue, else terminate; 5) increase voltage by .05, go to 1 or something like that.
Simply put you should not wind up in a situation where you have to turn the machine off because it is overheating. If you have, you've done something wrong. Although with the stock AMD or Intel coolers, expect the overclocking potential to be limited and make sure you read a guide on how to do it on your system.