Work with two HSM2 USB Nitrokeys to the same PC

Use the serial of the HSM.
See this example for nitrokey 3 Automatic Screen Lock at Removal script - #9 by bernd
The HSM has also a unique serial, but they start with ‘DENK’.