ALTER TABLE one_time_passwords ADD CONSTRAINT uniq_user_id_active UNIQUE (user_id, used_at);
