UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1n67+ABVnzHOkmD2Jy/82kH5j2AsvxORw4oqxRoEsxo='
WHERE
key_id = '5843bdb3da120bb3385e3091df29db90ce87c7f8d8710c4050ee71c3f10c4e2a'
AND (
token = '1n67+ABVnzHOkmD2Jy/82kH5j2AsvxORw4oqxRoEsxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)