You can use a translation keymap to pretend that when Emacs receives the input C-M-q, it's actually the encoding of a special function key. Since you want this to apply to all terminals and to override mode-specific bindings, put it in key-translation-map.
(define-key key-translation-map [?\e ?\C-q] [fake-key-C-M-q])
You can then bind the function key fake-key-C-M-q to whatever you like. It will have this effect everywhere. You can override that binding in specific modes if you like, for example the code below makes the key exit Emacs except while in a minibuffer.
(global-set-key [fake-key-C-M-q] 'save-buffers-kill-emacs) (define-key minibuffer-local-map [fake-key-C-M-q] 'ignore)