You can just scrape the mold off the top and the rest will be fine. If you are antsy about it, just scrape the mold off and then boil it.
I have done this many times with malt syrup when making beer. Malt and maple syrup have too high of a sugar content to grow mold. However, on the very top, moisture in the air can dilute the sugar content to a point where it will support mold growth. So the top will have mold, but not the whole container.
One other way to prevent this aside from refrigeration (which is a pain with 20 lb tubs of malt) is to put something on the top of the syrup that will block the air and prevent the top layer of the syrup of getting diluted. I used to use a 1/8" layer of cheap vodka on my malt syrup (I also use it in my fermentation airlocks instead of water), but that may make for interesting pancakes.