Ensure that a key is only assigned once

By updating at the same time as the select, we're ensuring that no two
users will get the same license key, as was report by Tokyo

Change-Id: Id2469b911f4e76f3aa391d351df507f9163a010a