How to lock an ATMega328P from cloning?
The lock bits can be used to prevent reading the code memory with standard programming tools. It only works up to a certain point, as a determined hacker with right tools can still extract and clone the firmware. So you can use the lock bits but don't expect that it will be 100% effective.