UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lntFdd8BjXPrr5dFaT7Q0I36JdKMPaLrFQHE2FRA3nM='
WHERE
key_id = '83756f3f8cf06b65d807062561fc3291a742b4db29a4d4e222a84e9483f99af4'
AND (
token = 'lntFdd8BjXPrr5dFaT7Q0I36JdKMPaLrFQHE2FRA3nM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)