I assume these buttons need not be available at the exact same frame as the player gathers enough resources to buy them.
If that assumption is true, you can divide your list of buttons into four or five lists, and iterate over each of them on a different frame. For disabling, you should still check every frame, or do a second check when the user clicks the button, to prevent the user from taking advantage of that extra frame to click again.
###Pseudocode:
Pseudocode:
buttons = [{costs:{lumber:10, gold:30}} ...]
buttonParts = divideArray(buttons, 4)
currentPart = 0
onUpdate():
currentPart = currentPart+1 % buttonParts.length //every frame process next list, looping back to 0
for btn in buttonParts[currentPart]:
canEnable = true
for {resource: costAmount} in btn.costs:
if PLAYER_RESOURCES[resource] < costAmount:
canEnable = false
break //exit resources loop if any resource is not enough
if canEnable:
btn.enable()