This addon will add a button in the viewport to turn on and off the camera lock. There's also onr for the cursor lock.
Once installed, they will appear next to the viewport's shading modes.
More info here: https://www.youtube.com/watch?v=cjdnnJFGpMs