UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XyU1YSoyHZ0hFkGwLNb6rKRl7vZWePn+O2sh9tBtbzw='
WHERE
key_id = '14277bb57766a5697b520f0c5adc9b104401c0fc0227df4590699bb6b2e6cff1'
AND (
token = 'XyU1YSoyHZ0hFkGwLNb6rKRl7vZWePn+O2sh9tBtbzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)