Can I use PHP function strtotime() in SQL queries?
UPDATE table
SET lasttime=TIME_FORMAT(SEC_TO_TIME(((SUBSTRING_INDEX(time,':',1)*60)+SUBSTRING_INDEX(time,':',-1))-480),'%i:%s');


Do the calculation in seconds then back to time,no need for php 

FIDDLE