UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+oRaWBVhEwmxVt7pz59T3lUvbRBsFQW/+TElStPomiA='
WHERE
key_id = 'dd79ab0933a7f52fc65e18a6990a2d6d5823e98b0f7c673981a7b70678238147'
AND (
token = '+oRaWBVhEwmxVt7pz59T3lUvbRBsFQW/+TElStPomiA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)