# Procedures DELIMITER ;; CREATE OR REPLACE PROCEDURE MTokens_CheckIfTokensForSameUser(IN MTID_A VARCHAR(128), IN MTID_B VARCHAR(128)) BEGIN SELECT COUNT(1) FROM MTokens WHERE id = MTID_A AND user_id = (SELECT user_id FROM MTokens WHERE id = MTID_B); END;; DELIMITER ;