UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lpblL9yHuN1Ma3LpW/jdb23YM6J8T3YdHMdG/fNXW5g='
WHERE
key_id = '1abdbb9c33b2f27fdba553ece2518d808bfc5da370197ac7f5724028635d2020'
AND (
token = 'lpblL9yHuN1Ma3LpW/jdb23YM6J8T3YdHMdG/fNXW5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)