UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm/ACudC71OQ4r35OCPKStAeFkzdsYU4FSMO0WC+7200='
WHERE
key_id = '1b8e0ec2183bf49b48f1d8a01cf88cbefacd100fedcbafea39bd123c4754bb75'
AND (
token = 'm/ACudC71OQ4r35OCPKStAeFkzdsYU4FSMO0WC+7200='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)