UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y2ZXXeI7Lh/5ZYbKPMf7vDd2IytF0rDs2kEalTJE+ps='
WHERE
key_id = '020989396d3c55e1dfd58ff62b164dbcaaff3eeb32b3a8c7344ed556aeff8be4'
AND (
token = 'Y2ZXXeI7Lh/5ZYbKPMf7vDd2IytF0rDs2kEalTJE+ps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)