UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QMEnSNNAvjAOyg9dc/sANQsGfLWyWNsnyn0ipIHesLg='
WHERE
key_id = '1ed45f04e2af6f0434ebd80b2e8b95948d8c3d3f09561f5f552f47ff1ea3e79e'
AND (
token = 'QMEnSNNAvjAOyg9dc/sANQsGfLWyWNsnyn0ipIHesLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)