"affordable" and "UV" don't normally mix well in the same sentences...
Emperor Aquatics SMART UV Sterilizers are one of the best known and well made, but the smallest they make is for 25W - 130 gal - Algae & Bacteria 30,000 µw/cm2 suggested/max gph 472/788, Protozoa 80,000 µw/cm2 suggested/max gph 79/131, Length 29" long... that's over-kill for a 40B.
...you'd be better off with a "Turbo-Twist UV Sterilizers" maybe but, even that's a bit over-priced for it's size.
almost forgot Aqua Ultraviolet Classic Series UV, they make a small unit that will work and build quality is good, still a bit high on the price.