UPDATE a,b
SET ps=if(ps='0','1',ps),uptime=if(ps='0',acttime,uptime),pw=if(ps='0','123',pw)
where eo_on in(select id from b where status ='1') and a.on=b.id