I've cleared immigration at Phoenix probably 20 times. Rarely has it taken longer than 30 minutes. BUT, then you have to re-enter the airport, be screened, etc. If you're leaving from Terminal 4 on your next flight, its perhaps do-able, but not advisable. If its T3 or T2 - no chance.
Depending on the ticket fare, airline, and FF status on your subsequent flight, you may be able to book the later connection and move-up to the earlier flight, even if for a small fee.