The two answers so far seem to be contradictory. In particular, the currently accepted answer from Brady suggests it is possible to keep all messages forever in iCloud, but only sync 30 days/1 year with a particular device, which is what both OP and I want.
However, according to both the earlier answer from Charlie and Does changing the Keep Messages setting on one device affect messages on all devices?, as well as my own unwitting testing, this is in fact not the case. As Charlie explained, iCloud syncs the Keep Messages setting, meaning when you change it on any device, iCloud will also only keep those messages. The forum post confirms this, as well as indicates that Apple reps themselves may not be aware that this is how it works (hence Brady’s answer, and the lack of documentation). It honestly seems like a design flaw to me.
OP and bmike, were you able to confirm what Brady said in your own testing? If so, I would love to find out how you got it to work. But if not, I believe it’s important for OP, if possible, to change the accepted answer to Charlie’s. Because others looking this up on Google and seeing only that answer may make the same mistake as me and lose almost 10 years' worth of valuable and irretrievable messages.