Individual persistent property per item in stock
You can use the beforeGenerateLicenseKey event and query for a custom key in your custom table and set the license key

Event::on(License::class, License::EVENT_GENERATE_LICENSE_KEY, function(GenerateKeyEvent $e) {
    $licenseKey = (new Query())
                      -&gt;select(['mykey'])
                      -&gt;from('{{%mytable}}')
                      -&gt;where(['used' =&gt; false])
                      -&gt;scalar();

    $e-&gt;licenseKey = $licenseKey;
});


And when you insert new keys in your custom DB table, you can change the stock of your variant accordingly

$variant = //grab the variant you need for your product
$variant-&gt;stock = (new Query())-&gt;from('mytable')-&gt;count();
// store the variant