I found this instruction worth trying.
Canceling means generating a 0 ETH transaction to your own address with the purpose of preventing a previous transaction from “going through” / “being mined” / “being included in the blockchain” / “being stuck”.
Step 1. Head to Etherscan.io or Ethplorer.io.
Step 2. Paste your transaction hash.
If it says pending, you can still try to cancel it.
If it says not found, click the button again, waiting a few minutes between each click. If that doesn’t work, it’s likely your transaction never went through.
If it says success, you cannot try to cancel it.
Step 3. If it says pending, access the wallet you used to send the original transaction on MEW.
Step 4. Send a transaction to yourself with a balance of 0 ETH.
Step 5. Click the ‘Send Transaction’ button.
Step 6. A dialog will appear. Click the “Yes, I’m Sure” button to send.
Step 7. A new transaction hash will appear. Click the link to view it and see if you were successful. If it doesn’t show up immediately, try refreshing in a few minutes.
I never tried it before but you can resort to this method. Usually when my transaction is pending Ive just replace it with higher gas but never actually tried to cancel it. Depends also on the miners and the gas fee you used. Chances that your first transaction to be replace by the second one is high as long as you put a higher has fee.