SET NAMES cp1250;
 UPDATE `crm_commisions` c 
SET 
	c.createAt = 
		LEAST(
			c.createAt, 
			IF(c.Data = '0000-00-00 00:00:00', c.alocaltime, c.Data),	
			IF(c.startTime = '0000-00-00 00:00:00', c.alocaltime, c.startTime),	
			c.alocaltime
		),
	c.alocaltime = c.alocaltime
WHERE 
	c.createAt > c.alocaltime
;
