UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LCtogy/aytjct9WjtRiu2egQn9MVN47yOKxevBl98Aw='
WHERE
key_id = '1e6ca30b1812b5729b684bbf3d9663b8077cdb73fb8c45eaf2e17ea16e273f39'
AND (
token = 'LCtogy/aytjct9WjtRiu2egQn9MVN47yOKxevBl98Aw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)