If you need to keep the status values up-to-date during INSERTs you can create trigger:
CREATE TRIGGER `tr1` AFTER INSERT ON `second_table`
FOR EACH ROW
BEGIN
IF NOT EXISTS (SELECT * FROM second_table WHERE status = 1 AND id_related = NEW.id_related ) THEN
UPDATE first_table SET status = 0 WHERE ID = NEW.id_related;
ELSE
UPDATE first_table SET status = 1 WHERE ID = NEW.id_related;
END IF;
END;
This will keep 1 for status in first_table while there are related rows in second_table having 1 as status and 0 otherwise. If you need to perform the same operation for UPDATEs of the second_table, you need to create the 'AFTER UPDATE' trigger with the same body as well.