I usually put my phone out of reach and sight but still in the same room. I also turn it on silent so I won’t be distracted by notifications but can still listen to music. I also tend to take a break for a few minutes if I can’t concentrate anymore.
I think a way you can fully concentrate is to put every electronic in a different room so you don’t feel tempted to get on them. Also you said that you can only concentrate for about 30 minutes, so maybe exercise an hour or half an hour before you do all you consentration stuff, This will work because if you exercise then oxygen will go into your brain and you will feel more energized and consentrated. If your really want to listen to music then put on headphones and put the phone behind you and still listen so you don’t feel tempted.