UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tp0Xk7/+BQUmEI0P6dU2hG8qifm44Oz1ao+hdmkI9FY='
WHERE
key_id = '84c7a659a2ad14628b81ccc081e2a05cd96eba692720f7dab4a3400bdec0cac6'
AND (
token = 'Tp0Xk7/+BQUmEI0P6dU2hG8qifm44Oz1ao+hdmkI9FY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)