There are modules out there to do such things... however, it wouldn't be too difficult to write a SP that gets called on completion, that looks at the date of the sale in the cart, assigns the role, and sets the expiration date.
A dozen lines of code, tops. :)