UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zXQQrUAApgMEgsaJAXMG+yUnAK/sD27rq3V8sHuzRyg='
WHERE
key_id = '1de816f021117314fc5597b5dafda6efff360f665d10b1a9c79dd2bcf285f338'
AND (
token = 'zXQQrUAApgMEgsaJAXMG+yUnAK/sD27rq3V8sHuzRyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)