In
/etc/udev/rules.d/
you can write a script
SUBSYSTEM=="usb", SYSFS{idProduct}=="PPPP", SYSFS{idVendor}=="VVVV", RUN+="/usr/sbin/usb-locking"
where PPPP and VVVV are values you can extract with lsusb
.
Every identic product will match, but usb-locking could mount the device, and look at the drive itself for further legitimation - some file, some bytecode in there, the date ...
It's vulnerable if somebody else get's access to the stick, of course.
The script could further look every minute, whether the stick is still mounted, and lock if not.