Using the RPC command importprivkey always gives a warning message in the log about already having the script, even if the key is not yet known. Repro when the key is not known yet:
$ src/bitcoind -regtest -daemon
$ src/bitcoin-cli -regtest importprivkey cPRXsaa4WtDYmyvhT7KjT5hEJvNWndyXphTmHn2J6BYhxLt8cREn
$ tail $HOME/.bitcoin/regtest/debug.log
…
2019-08-24T14:33:58Z [default wallet] Already have script 0014d75ad18779e20b8c6e0d6b28dee92ef4069dd2cb, skipping
When the key is already known:
2019-08-24T14:41:33Z [default wallet] Already have key with pubkey 0327d77baf35f9aadb9fa84ebb87d2b5a56386164a4a86119e919bd65aec52a150, skipping
2019-08-24T14:41:33Z [default wallet] Already have script 0014d75ad18779e20b8c6e0d6b28dee92ef4069dd2cb, skipping