Same nonce, higher gas fee.
It doesn't need to have the same data or address. If you want to cancel the transaction you can send yourself 0 eth (or any sum as it is coming back to you).
I know from experience though couldn't find a good written explanation. For an additional source you could look at the web3py requirements for their replace_transaction that falls back to ethSendTransaction RPC method:
If the new_transaction specifies a nonce value, it must match the
pending transaction’s nonce.
If the new_transaction specifies maxFeePerGas and maxPriorityFeePerGas
values, they must be greater than the pending transaction’s values for
each field, respectively.
Legacy Transaction Support (Less Efficient - Not Recommended)
If the pending transaction specified a gasPrice value (legacy
transaction), the gasPrice value for the new_transaction must be
greater than the pending transaction’s gasPrice.
https://web3py.readthedocs.io/en/stable/web3.eth.html#web3.eth.Eth.replace_transaction
Will say in testing, have only needed to increase maxFeePerGas and not maxPriorityFeePerGas
Mild reinforcement of the concept:
"replacing the transaction with a slightly more lucrative one
with the same nonce"
https://ethereum.org/en/whitepaper/#decentralized-file-storage
Good general guide:
If the second transaction is confirmed onto the blockchain (e.g. by sending a new transaction with the same nonce and a higher gas price), the “dropped” transaction will be moved into the new transaction status category known as “Dropped & Replaced”.
https://docs.alchemy.com/docs/how-to-cancel-a-private-transaction-on-ethereum