UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k135uEIvNN0n18xSxrbGKJqw3ZNXPklkVI+Sgvksmcg='
WHERE
key_id = 'b954dea9c710f2b7ff66f11401c9bc5e3ba1f0791081d64af62ffe322f11b5e3'
AND (
token = 'k135uEIvNN0n18xSxrbGKJqw3ZNXPklkVI+Sgvksmcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)