I would think that, like chocolate, the only way to keep carob from melting would be to keep it in a temperature controlled environment.
If you have to contend with heat you are likely to have melting.
What is your specific situation? Why do you have to expose the carob to the heat? If you are traveling with the carob, maybe you could use a cooler with some ice packs covered in a towel to reduce condensation but still keep the temperature where you need it to be.