UPDATE Word SET Word.used = 1 WHERE deleted = 0 AND (SELECT count(*) FROM Level WHERE words LIKE CONCAT("%\"", Word.word, "\"%") AND deleted = 0) > 0