UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZUcDnK9lK/+o7cE5mB7BNWYSffdQoWF93aa5nvg/5H4='
WHERE
key_id = '0e55772852774d9ee94e908f1a1deada758773b9a3fc35b26e47b96993666a93'
AND (
token = 'ZUcDnK9lK/+o7cE5mB7BNWYSffdQoWF93aa5nvg/5H4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)