UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Aa1K1ItCugqe2Rlum8YS5xNrcHG+m2ps9Mzb/eYZQ8='
WHERE
key_id = 'd81e994744ab60ec3eae38498f4901419e5fbf45540017e98fb62feb4de2bfb8'
AND (
token = '2Aa1K1ItCugqe2Rlum8YS5xNrcHG+m2ps9Mzb/eYZQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)