$(this).val($(this).val().substr(0, maxLength));INSERT INTO `table` (`two`, `three`)
SELECT `t1`.`two`, `t1`.`three`
FROM (
SELECT :two AS `two`, :three AS `three`
) AS `t1`
LEFT JOIN `table` AS `t2` USING (`two`, `three`)
WHERE `t2`.`two` IS NULL;