gpg_refresh_keys.py - corrected query logic