No you cannot, masturbation is haram and you must immediately stop. Allah says in the Qu'ran,
"And those who guard their chastity (i.e. private parts, from illegal sexual acts). Except from their wives or (the captives and slaves) that their right hands possess, - for them, they are free from blame. But whoever seeks beyond that, then those are the transgressors." 23.5-7 Here the verses are clear in forbidding all illegal sexual acts (including masturbation) except for the wives or that their right hand possess. And whoever seeks beyond that is the transgressor.
"And let those who find not the financial means for marriage keep themselves chaste, until Allah enriches them of His bounty." 24.33. This verse also clearly orders whoever does not have the financial means to marry to keep himself chaste and be patient in facing temptations (including masturbation) until Allah enriches them of His
bounty.
Based on these verses, masturbation is haram for all Muslims but some scholars say that you can only do it for a fertility test. You are delaying your salah and missing them is a very major sin so you must repent as much as you can.
If your sexual desires are high, then you should marry, if you cannot then you should fast as it would keep you away from evil desires.
For more information go to :
https://islamqa.info/en/329