You will need some sort of insulated container to maintain your medication cold while you are walking during the day.
It would help immensely if you had a preprinted note in English and Spanish, Portuguese, etc.) that explained what medication you take and how it must be stored at a low temperature, such as in a refrigerator. The note should politely request that you be able to store this plastic bag, containing your medication in their refrigerator / freezer overnight, and that you will reclaim it by (SET A TIME) the next morning before you leave. Bring extra copies of the note in case you need them.
Include your local contact information, mobile #, e-mail, etc, just in case you forget and get all the way to the next town before you remember that you forgot to reclaim your meds. Do not panic! The person in the previous village can put the meds in n outer bag with ice and send it in a taxi to you. it has happened to others and for lots of different things like smart phones, passports, wallets, etc.
When you stop for the evening at an albergue or a hostal, ask to place your medication (in a ziplock bag with your name on it) in their refrigerator. Recharge your freezer pack / cells for the next day in their freezer.
I have encountered and walked with diabetics who tell me of a number of methods they use to keep their meds at the correct temperature. What I already stated, above, is Plan A.
Plan B is to approach a local cafe owner, who will also be open in the morning for breakfast with a similar request.
Plan C would be to do the same thing at a local tienda (front room market) that sells refrigerated and / or frozen foods. You can deposit your bag at closing time and pick it up first thing in the morning.
Plan D, and people tell me this actually works, is to approach either the local priest or the local police with the same request.
Anecdotally, I have never heard of such a request being denied. Although I presume you might have to work your way through the various plans to find a solution that works.
I hope this helps...