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