UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/ycqxCpieFupTA1XfFGEcB5VHpZy7JWwOeIfFF7X2WM='
WHERE
key_id = 'efd57beca8b723b80cbcf7465b1a0f9ee57b8b0d9bf42d33e423e90db69917eb'
AND (
token = '/ycqxCpieFupTA1XfFGEcB5VHpZy7JWwOeIfFF7X2WM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)