You can also tell Firefox to ignore it completely:
browser.quitShortcut.disabled
As well as to warn:
browser.warnOnQuit
browser.warnOnQuitShortcut
Well, apparently I once was aware of these because I have it set in my custom user.js. But I guess ctrl-q will always be lock screen for me, old habits die hard.
I don’t know if the above is still the default, but I have this in my gnome setup scripts anyway:
gsettings set org.gnome.settings-daemon.plugins.media-keys screensaver “[‘<Control>q’]”
(IIRC it’s a terminal command because trying to bind ctrl-q in Settings will quit the Settings window. And you can’t unbind ctrl-q completely, so you have to bind it to something else. You could maybe add it as a custom launcher that just runs /bin/true.)