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